<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
         <script src="js/jquery.js"></script>
	</head>
	<body>
        <script>
            /* 绑定事件 */
            	var book_id;
            	var account;
            	  var url=window.location.search;
            	  if(url.indexOf("?")!=-1){
            	  var str = url.substr(1);
            	     strs = str.split("&"); 
            	     var key=new Array(strs.length);
            	     var value=new Array(strs.length);
            	     for(i=0;i<strs.length;i++){
            	      key[i]=strs[i].split("=")[0]
            	      value[i]=unescape(strs[i].split("=")[1]);
            	    } 
            	    book_id=value[1];
            	    account=value[0];
            	  } 
            	
            	 var json={"book_id":book_id,"account":account};
                   
                   var jsonstr=JSON.stringify(json);
                      $.ajax({
                          
                          type:'post',
                           url:'http://127.0.0.1:8080/return',
                             contentType:"application/json;chartset=utf-8",
                           data:jsonstr,
                          success:function(){
                               alert("还书成功");
                               window.location.href='个人信息.html?account='+account;
                          },
                           error:function(){
                                  alert("还书失败,请重新操作");
                                 window.location.href='个人信息.html?account='+account;
                              }
                              
                      })
            	
            
                
            </script>
	</body>
</html>
